def icp():
    eles="""Li
    Be
    B
    Na
    Mg
    Al
    Si
    P
    S
    Cl
    K
    Ca
    Sc
    Ti
    V
    Cr
    Mn
    Fe
    Co
    Ni
    Cu
    Zn
    Ga
    Ge
    As
    Se
    Br
    Rb
    Sr
    Y
    Zr
    Nb
    Mo
    Ru
    Rh
    Pd
    Ag
    Cd
    In
    Sn
    Sb
    Te
    I
    Cs
    Ba
    La
    Ce
    Pr
    Nd
    Sm
    Eu
    Gd
    Tb
    Dy
    Ho
    Er
    Tm
    Yb
    Lu
    Hf
    Ta
    W
    Re
    Os
    Ir
    Pt
    Au
    Hg
    Tl
    Pb
    Bi
    Th
    U
    Al2O3
    Au2O
    BaO
    B2O3
    CaO
    Co2O3
    Cr2O3
    Cs2O
    CuO
    Fe2O3
    Y2O3
    CeO2
    ZrO2
    K2O
    MgO
    MnO
    MnO2
    Na2O
    NiO
    P2O5
    PbO
    PtO2
    Rh2O3
    SiO2
    SnO2
    SO4
    TeO2
    TiO2
    U3O8
    V2O5
    ZnO
    Alt
    Als
    溶解Zr"""
    eles=eles.split("\n")
    def gen():
        r=[]
        for one in eles:
        	r.append("""{
                    "name": "%s",
                    "type": "item",
                    "alias": "%s",
                    "titleName": "%s"
                }""" % (one,one,one))
        eles_out=",".join(r)+","
        out="""{
            "col":
            [
                {
                    "dict":
                    [{
                            "alias": "二级方法",
                            "delimiter": "&",
                            "identifier": "ejff"
                        },
                        {
                            "alias": "二级分析技术",
                            "delimiter": "&",
                            "identifier": "ejfxjs"
                        },
                        {
                            "alias": "方法编号",
                            "delimiter": "&",
                            "identifier": "ffbh"
                        },
                        {
                            "alias": "试验员",
                            "delimiter": "&",
                            "identifier": "syy"
                        },
                        {
                            "alias": "一审人员",
                            "delimiter": "&",
                            "identifier": "ysry"
                        },
                        {
                            "alias": "一审时间",
                            "delimiter": "&",
                            "identifier": "yssj"
                        },
                        {
                            "alias": "仪器编号",
                            "delimiter": "&",
                            "identifier": "yqbh"
                        },
                        {
                            "alias": "实验员签名",
                            "delimiter": "&",
                            "identifier": "syyqm"
                        },
                        {
                            "alias": "浓度",
                            "delimiter": "&",
                            "identifier": "nd"
                        },
                        {
                            "alias": "波长",
                            "delimiter": "&",
                            "identifier": "bc"
                        },
                        {
                            "alias": "天平编号",
                            "delimiter": "&",
                            "identifier": "tpbh"
                        },
                        {
                            "alias": "内标元素",
                            "delimiter": "&",
                            "identifier": "nbys"
                        }
                    ],
                    "isPK": "true",
                    "name": "样品编号",
                    "type": "sample",
                    "alias": "SampleCode",
                    "ifHandle": "false",
                    "exeScript": "",
                    "preHandle": "true",
                    "titleName": "id",
                    "rowFilterScript": "v.length()>=1"
                },
                %s
                {
                    "name": "样品质量",
                    "type": "args",
                    "alias": "SampleMass",
                    "titleName": "mass"
                },
                {
                    "name": "定容体积",
                    "type": "args",
                    "alias": "volume",
                    "titleName": "volume"
                },
                {
                    "name": "稀释倍数",
                    "type": "args",
                    "alias": "xsbs",
                    "titleName": "稀释倍数"
                }
            ],
            "name": "测试",
            "start":
            {
                "dataMode": "fixed",
                "startRow": "1",
                "titleRow": "0",
                "findPosScript": ""
            },
            "charSet": "GBK",
            "special":
            {
                "specialSamples": "BLK_SI,BLK,BC,XS"
            },
            "parserMode": "name",
            "parserSource": "file-excel"
        }""" % eles_out
        f=open("icp.json","w",encoding="utf-8")
        f.write(out)
        f.close()
    gen()
def diding():
    eles="""Fe
Al
Ni
CaO
V2O5
S
Ca
Sn
Fe2O3
Zr
Ag
Cr
Ti
V
As
Bi
B
Mn
N
Co
Mg
Cu
Pt
Au
Pd
Cd
Cl"""
    eles=eles.split("\n")
    def gen():
        r=[]
        for one in eles:
            r.append("""{
                    "name": "%s",
                    "type": "item",
                    "alias": "%s",
                    "titleName": "%s"
                }""" % (one,one,one))
        eles_out=",".join(r)+","
        out="""{
    "col": [
        {
            "dict":[
                {
                    "alias": "二级方法",
                    "delimiter": "&",
                    "identifier": "ejff"
                },
                {
                    "alias": "二级分析技术",
                    "delimiter": "&",
                    "identifier": "ejfxjs"
                },
                {
                    "alias": "方法编号",
                    "delimiter": "&",
                    "identifier": "ffbh"
                },
                {
                    "alias": "试验员",
                    "delimiter": "&",
                    "identifier": "syy"
                },
                {
                    "alias": "一审人员",
                    "delimiter": "&",
                    "identifier": "ysry"
                },
                {
                    "alias": "一审时间",
                    "delimiter": "&",
                    "identifier": "yssj"
                },
                {
                    "alias": "仪器编号",
                    "delimiter": "&",
                    "identifier": "yqbh"
                },
                {
                    "alias": "实验员签名",
                    "delimiter": "&",
                    "identifier": "syyqm"
                },
                {
                    "alias": "氧化物系数",
                    "delimiter": "&",
                    "identifier": "dict0"
                },
                {
                    "alias": "分析元素质量数",
                    "delimiter": "&",
                    "identifier": "dict1"
                },
                {
                    "alias": "天平编号",
                    "delimiter": "&",
                    "identifier": "dict2"
                },
                {
                    "alias": "溶液浓度",
                    "delimiter": "&",
                    "identifier": "dict3"
                }
            ],
            "isPK": "true",
            "name": "样品编号",
            "type": "sample",
            "alias": "SampleCode",
            "ifHandle": "false",
            "exeScript": "",
            "preHandle": "true",
            "titleName": "样品中心编号",
            "rowFilterScript": "v.length()>=1"
        },
        %s
        {
            "name": "arg0",
            "type": "args",
            "alias": "arg0",
            "titleName": "试料质量m，g"
        },
        {
            "name": "arg1",
            "type": "args",
            "alias": "arg1",
            "titleName": "定容体积V8,mL"
        },
        {
            "name": "arg2",
            "type": "args",
            "alias": "arg2",
            "titleName": "分取体积V9,mL"
        },
        {
            "name": "arg3",
            "type": "args",
            "alias": "arg3",
            "titleName": "滴定体积V11，mL"
        }
    ],
    "name": "测试",
    "start": {
        "dataMode": "fixed",
        "startRow": "1",
        "titleRow": "0",
        "findPosScript": ""
    },
    "charSet": "GBK",
    "special": {
        "specialSamples": "BLK"
    },
    "parserMode": "name",
    "parserSource": "file-excel"
}""" % eles_out
        f=open("diding.json","w",encoding="utf-8")
        f.write(out)
        f.close()
    gen()
diding()